package com.xijia.wuyouwallet;

import android.app.Application;
import android.util.DisplayMetrics;

import com.jakewharton.disklrucache.DiskLruUtil;
import com.mob.MobSDK;
import com.xijia.wuyouwallet.bean.SystemData;
import com.xijia.wuyouwallet.bean.UserData;
import com.xijia.wuyouwallet.config.FusionField;

import org.xutils.x;

/**
 * Created by Administrator on 2017/7/11 0011.
 */

public class MyApp extends Application {

    private static MyApp sInstance;

    public static UserData userData = null;

    public static boolean isRefresh = false;

    public static boolean isAttentionJump = false;


    public static boolean isCard = false;

    public static boolean isBankFinsh = false;

    public static boolean isChoiseCard = false;

    public static boolean isRateResh = false;

    public static SystemData systemData = null;

    public static boolean isRefund = false;

    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;

        x.Ext.init(this);//初始化org包的xUtils
        MobSDK.init(this,"221b663541ced","f60630df445e1587d5cf47ed7888c5c6");

        //JPushInterface.setDebugMode(true);
        //JPushInterface.init(this);

        initSystemParams();

    }

    public static MyApp getInstance() {
        return sInstance;
    }


    private void initSystemParams(){
        DisplayMetrics dm = getResources().getDisplayMetrics();
        FusionField.devicePixelsHeight = dm.heightPixels;
        FusionField.devicePixelsWidth = dm.widthPixels;
        FusionField.deviceDensity = dm.density;
        FusionField.currentVersion = DiskLruUtil.getCurrentAppVersion(this);
        FusionField.currentCode = DiskLruUtil.getCurrentAppVersionCode(this);
    }

}
